import request from '@/config/axios'

// 店铺入驻套餐 VO
export interface EnterPackageVO {
  id: number | string // 唯一编号
  year: number // 年限
  price: number // 价格(单位：分)
}

// 店铺入驻套餐 API
export const EnterPackageApi = {
  // 查询店铺入驻套餐列表
  getEnterPackageList: async () => {
    return await request.get({ url: `/shop/enter-package/list` })
  },

  // 查询店铺入驻套餐分页
  getEnterPackagePage: async (params: any) => {
    return await request.get({ url: `/shop/enter-package/page`, params })
  },

  // 查询店铺入驻套餐详情
  getEnterPackage: async (id: number | string) => {
    return await request.get({ url: `/shop/enter-package/get?id=` + id })
  },

  // 新增店铺入驻套餐
  createEnterPackage: async (data: EnterPackageVO) => {
    return await request.post({ url: `/shop/enter-package/create`, data })
  },

  // 修改店铺入驻套餐
  updateEnterPackage: async (data: EnterPackageVO) => {
    return await request.post({ url: `/shop/enter-package/update`, data })
  },

  // 删除店铺入驻套餐
  deleteEnterPackage: async (id: number | string) => {
    return await request.get({ url: `/shop/enter-package/delete?id=` + id })
  },

  // 导出店铺入驻套餐 Excel
  exportEnterPackage: async (params) => {
    return await request.download({ url: `/shop/enter-package/export-excel`, params })
  }
}
